@extends('index.lay')
@section('title', '我要买车')

@section('nav')
<ul>
<li><a href="/">首页</a></li>
<li class="active"><a href="/NewCars">新车</a></li>
<li><a href="/Company">了解筋斗车</a></li>
<li><a href="/FAQ">筋斗问答</a></li>
<!-- <li class="hidden" id="login_button"><a href="#">登录</a></li> -->
<!-- <li class="header_mine">我的<i class="fa fa-caret-down"></i></li> -->
</ul>
<!-- <div class="hidden_mine">
    <div><a href="mine_order.html">我的预约</a></div>
    <div><a href="mine_heart.html">我的关注</a></div>
    <div><a href="#">退出</a></div>
</div> -->
@endsection

@section('container-last')

@endsection


@section('container-content')
   <form>
        <div class="newcar_select">
            <div class="newcar_select_city">
                <span id="select_city">全国<i class="fa fa-caret-down"></i></span>
                <div class="newcar_select_city_hidden">
                     <div class="newcar_local_city">
                          <span>获取当前位置失败</span>
                     </div>
                                      <div class="newcar_city_mulu">
                                         <ul>
                                           <li><a href="#">A</a></li>
                                            <li><a href="#">B</a></li>
                                            <li><a href="#">C</a></li>
                                            <li><a href="#">F</a></li>
                                            <li><a href="#">G</a></li>
                                            <li><a href="#">H</a></li>
                                            <li><a href="#">J</a></li>
                                            <li><a href="#">L</a></li>
                                            <li><a href="#">N</a></li>
                                            <li><a href="#">S</a></li>
                                            <li><a href="#">T</a></li>
                                            <li><a href="#">Y</a></li>
                                            <li><a href="#">Z</a></li>
                                        </ul>
                                    </div>
                                    <div class="newcar_city_table">
                                        <div>
                                            <ul class="city_title">
                                                <li>*</li>
                                                <li><a href="#">全国</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>

                                        <div>
                                            <ul class="city_title">
                                                <li>A</li>
                                                <li><a href="#">安徽</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>B</li>
                                                <li><a href="#">北京</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>C</li>
                                                <li><a href="#">重庆</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>F</li>
                                                <li><a href="#">福建</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>G</li>
                                                <li><a href="#">广东</a></li>
                                                <li><a href="#">广西</a></li>
                                                <li><a href="#">甘肃</a></li>
                                                <li><a href="#">贵州</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>H</li>
                                                <li><a href="#">海南</a></li>
                                                <li><a href="#">河北</a></li>
                                                <li><a href="#">河南</a></li>
                                                <li><a href="#">黑龙江</a></li>
                                                <li><a href="#">湖北</a></li>
                                                <li><a href="#">湖南</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>J</li>
                                                <li><a href="#">吉林</a></li>
                                                <li><a href="#">江苏</a></li>
                                                <li><a href="#">江西</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>L</li>
                                                <li><a href="#">辽宁</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>N</li>
                                                <li><a href="#">内蒙古</a></li>
                                                <li><a href="#">宁夏</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>S</li>
                                                <li><a href="#">山西</a></li>
                                                <li><a href="#">山东</a></li>
                                                <li><a href="#">上海</a></li>
                                                <li><a href="#">陕西</a></li>
                                                <li><a href="#">四川</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>T</li>
                                                <li><a href="#">天津</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div>
                                            <ul class="city_title">
                                                <li>Y</li>
                                                <li><a href="#">云南</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                         <div>
                                            <ul class="city_title">
                                                <li>Z</li>
                                                <li><a href="#">浙江</a></li>
                                            </ul>
                                            <div class="clearfix"></div>
                                        </div>
                                    </div>
                                </div>
                <div class="select_cpntainer">
                    <div class="newcar_select_all">
                        <div class="newcar_select_option row">
                            <div class="col-md-2 select_title">
                                <span>品牌</span>
                            </div>
                            <div class="col-md-10 select_content">
                                <ul>
                                    <li class="brand_liselect {{!isset($request->brand)||$request->brand==''?'active':''}}" val=""><a href="javascript:void(0)">全部</a></li>
                                    @for($i=0;$i<count($brand);$i++)
                                    <li class="brand_liselect {{$brand[$i]==$request->brand?'active':''}}" val="{{$brand[$i]}}"><a href="javascript:void(0)">{{$brand[$i]}}</a></li>
                                    @endfor
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!-- <div class="newcar_select_all">
                        <div class="newcar_select_option row">
                            <div class="col-md-2 select_title">
                                <span>服务费</span>
                            </div>
                            <div class="col-md-10 select_content">
                                <ul>
                                    <li class="payments_liselect {{!isset($request->payments)||$request->payments==''?'active':''}}" val=""><a href="javascript:void(0)">全部</a></li>
                                    <li class="payments_liselect {{$request->payments=='10000'?'active':''}}" val="10000"><a href="javascript:void(0)">1万以内</a></li>
                                    <li class="payments_liselect {{$request->payments=='10000-20000'?'active':''}}" val="10000-20000"><a href="javascript:void(0)">1-2万</a></li>
                                    <li class="payments_liselect {{$request->payments=='20000-30000'?'active':''}}" val="20000-30000"><a href="javascript:void(0)">2-3万</a></li>
                                    <li class="payments_liselect {{$request->payments=='30000-40000'?'active':''}}" val="30000-40000"><a href="javascript:void(0)">3-4万</a></li>
                                    <li class="payments_liselect {{$request->payments=='40000-50000'?'active':''}}" val="40000-50000"><a href="javascript:void(0)">4-5万</a></li>
                                    <li class="payments_liselect {{$request->payments=='50000'?'active':''}}" val="50000"><a href="javascript:void(0)">5万以上</a></li>
                                </ul>
                            </div>
                        </div>
                    </div> -->
                    <!-- <div class="newcar_select_all">
                        <div class="newcar_select_option row">
                            <div class="col-md-2 select_title">
                                <span>月租金</span>
                            </div>
                            <div class="col-md-10 select_content">
                                <ul>
                                    <li class="MonthPay_liselect {{!isset($request->MonthPay)||$request->MonthPay==''?'active':''}}" val=""><a href="#">全部</a></li>
                                    <li class="MonthPay_liselect {{$request->MonthPay=='2000'?'active':''}}" val="2000"><a href="#">2000元以内</a></li>
                                    <li class="MonthPay_liselect {{$request->MonthPay=='2000-3000'?'active':''}}" val="2000-3000"><a href="#">2000-3000元</a></li>
                                    <li class="MonthPay_liselect {{$request->MonthPay=='3000-4000'?'active':''}}" val="3000-4000"><a href="#">3000-4000元</a></li>
                                    <li class="MonthPay_liselect {{$request->MonthPay=='4000-5000'?'active':''}}" val="4000-5000"><a href="#">4000-5000元</a></li>
                                    <li class="MonthPay_liselect {{$request->MonthPay=='5000'?'active':''}}" val="5000"><a href="#">5000元以上</a></li>
                                </ul>
                            </div>
                        </div>
                    </div> -->
                    <div class="newcar_select_all">
                        <div class="newcar_select_option row">
                            <div class="col-md-2 select_title">
                                <span>车价</span>
                            </div>
                            <div class="col-md-10 select_content">
                                <ul>
                                    <li class="price_liselect {{!isset($request->price)||$request->price==''?'active':''}}" val=""><a href="#">全部</a></li>
                                    <li class="price_liselect {{$request->price=='100000'?'active':''}}" val="100000"><a href="#">10万以内</a></li>
                                    <li class="price_liselect {{$request->price=='100000-200000'?'active':''}}" val="100000-200000"><a href="#">10-20万</a></li>
                                    <li class="price_liselect {{$request->price=='200000-300000'?'active':''}}" val="200000-300000"><a href="#">20-30万</a></li>
                                    <li class="price_liselect {{$request->price=='300000-400000'?'active':''}}" val="300000-400000"><a href="#">30-40万</a></li>
                                    <li class="price_liselect {{$request->price=='400000-500000'?'active':''}}" val="400000-500000"><a href="#">40-50万</a></li>
                                    <li class="price_liselect {{$request->price=='500000-600000'?'active':''}}" val="500000-600000"><a href="#">50-60万</a></li>
                                    <li class="price_liselect {{$request->price=='600000-1000000'?'active':''}}" val="600000-1000000"><a href="#">60-100万</a></li>
                                    <li class="price_liselect {{$request->price=='10000000'?'active':''}}" val="10000000"><a href="#">100万元以上</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="newcar_select_all">
                        <div class="newcar_select_option row">
                            <div class="col-md-2 select_title">
                                <span>车型</span>
                            </div>
                            <div class="col-md-10 select_content">
                                <ul>
                                    <li class="Models_liselect {{!isset($request->Models)||$request->Models==''?'active':''}}" val=""><a href="#">全部</a></li>
                                    <li class="Models_liselect {{$request->Models=='微小型车'?'active':''}}" val="微小型车"><a href="#">微小型车</a></li>
                                    <li class="Models_liselect {{$request->Models=='紧凑型车'?'active':''}}" val="紧凑型车"><a href="#">紧凑型车</a></li>
                                    <li class="Models_liselect {{$request->Models=='中型车'?'active':''}}" val="中型车"><a href="#">中型车</a></li>
                                    <li class="Models_liselect {{$request->Models=='中大型车'?'active':''}}" val="中大型车"><a href="#">中大型车</a></li>
                                    <li class="Models_liselect {{$request->Models=='SUV'?'active':''}}" val="SUV"><a href="#">SUV</a></li>
                                    <li class="Models_liselect {{$request->Models=='MPV'?'active':''}}" val="MPV"><a href="#">MPV</a></li>
                                    <li class="Models_liselect {{$request->Models=='跑车'?'active':''}}" val="跑车"><a href="#">跑车</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="newcar_select_all newcar_select_all_selected where_div">
                        <div class="newcar_select_option row">
                            <div class="col-md-2 select_title">
                                <span>已选条件</span>
                            </div>
                            <div class="col-md-10 select_content ">
                                <div class="delete_selected_option where_reset">
                                    <a href="#">
                                        <img src="/style/images/shuaxi.png">
                                        <span>重置条件</span>
                                    </a>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <div class="index_newcar_title">
        <span>为您找到{{$cars->total()}}款新车</span>
        <div class="newcar_orderby">
            <ul>
                <li {{$request->order=='preferentialRatio' || $request->order==''? 'class=active' : ''}}><a href="javascript:void(0)" class="orderby_default">默认</a></li>
                @if($request->order=='FirstPay_1')
                <li id="orderby_1" class="active"><a href="javascript:void(0)" class="orderby_servicemony" type_='desc'>服务费<i class="fa fa-long-arrow-down"></i></a></li>
                @elseif($request->order=='FirstPay_2')
                 <li id="orderby_1" class="active"><a href="javascript:void(0)" class="orderby_servicemony" type_='asc'>服务费<i class="fa fa-long-arrow-up"></i></a></li>
                @else
                <li id="orderby_1"><a href="javascript:void(0)" class="orderby_servicemony" type_='desc'>服务费<i class="fa fa-long-arrow-up"></i></a></li>
                @endif
                @if($request->order=='MonthPay_1')
                <li id="orderby_2" class="active"><a href="javascript:void(0)" class="orderby_month" type_='desc'>月租金<i class="fa fa-long-arrow-down"></i></a></li>
                @elseif($request->order=='MonthPay_2')
                <li id="orderby_2" class="active"><a href="javascript:void(0)" class="orderby_month" type_='asc'>月租金<i class="fa fa-long-arrow-up"></i></a></li>
                @else
                <li id="orderby_2"><a href="javascript:void(0)" class="orderby_month" type_='desc'>月租金<i class="fa fa-long-arrow-up"></i></a></li>
                @endif
            </ul>
        </div>
        <div class="clearfix"></div>
    </div>

    <div class="newcar_content">
        <ul>
            @foreach($cars as $k=>$v)
            <li>
                <a href="/details?carid={{$v->id}}">
                    <div class="newcar_img"><img src="{{$carurl}}{{$v->carnum}}/1.jpg"></div>
                    <span class="newcar_title elec">{{$v->name}}</span>
                    <span class="newcar_info elec">{{$v->details}}</span>
                    <span class="zhidao_price elec">指导价：{{FormatMoney($v->guide_price)}}起</span>
                    <!-- <span style="color: red;display: block;font-weight:  bold;font-size:;font-size:15px">筋斗价:{{FormatMoney($v->jdc_price)}}</span> -->
                    <!-- <span class="newcar_pay elec">服务费{{FormatMoney($v->first_pay)}}</span>
                    <span class="newcar_month">月租金{{FloatEnInt($v->month_pay)}}元</span> -->
                </a>
            </li>
            @endforeach
        </ul>
        <div class="clearfix"></div>
    </div>

    <div class="newcar_fenye">
        {!!$cars->appends($request->all())->render()!!}
    </div>
@endsection


@section('container-after')

@endsection

@section('include-js')
<script type="text/javascript" src="/style/js/carlist.js"></script>
@endsection

@section('write-js')
<script type="text/javascript">
    $(document).ready(function () {
        $(window).bind("scroll", function () {
            var sTop = $(window).scrollTop();
            var sTop = parseInt(sTop);
            if (sTop >= 130) {
                $("#scrollTopDiv").removeClass("hidden");
            }
            else {
                $("#scrollTopDiv").addClass("hidden");
            }
        });
        $("#aside1").hover(function () {
            $(".aside_fixed_hidden_1").toggleClass("hidden");
        });
        $("#aside2").hover(function () {
            $(".aside_fixed_hidden_2").toggleClass("hidden");
        });
        $("#aside3").hover(function () {
            $(".aside_fixed_hidden_3").toggleClass("hidden");
        });
        $(".index_header_search_input").focus(function(){
            $(".index_header_hidden_hot_search").fadeIn(500);
        });
        $(".index_header_search_input").blur(function(){
            $(".index_header_hidden_hot_search").fadeOut(500);
        });
        $(".newcar_select_city span").click(function () {
            $(".newcar_select_city i").toggleClass("fa-caret-down");
            $(".newcar_select_city i").toggleClass("fa-caret-up");
        });
        $("#select_city").click(function (e) {
            $(".newcar_select_city_hidden").fadeToggle(300);
            e.stopPropagation();
        });
        $("body").click(function () {
            $(".newcar_select_city_hidden").fadeOut(300);
        });
        $("#orderby_1").click(function () {
            $("#orderby_1 i").toggleClass("fa-long-arrow-up");
            $("#orderby_1 i").toggleClass("fa-long-arrow-down");
        });
        $("#orderby_2").click(function () {
            $("#orderby_2 i").toggleClass("fa-long-arrow-up");
            $("#orderby_2 i").toggleClass("fa-long-arrow-down");
        });
        $(".header_mine").hover(function () {
            $(".header_mine i").addClass("fa-caret-up");
            $(".header_mine i").removeClass("fa-caret-down");
            $(".hidden_mine").css("display","block");
        },function () {
            $(".hidden_mine").css("display","none");
            $(".header_mine i").addClass("fa-caret-down");
            $(".header_mine i").removeClass("fa-caret-up");
        });
        $(".hidden_mine").hover(function () {
            $(this).css("display","block");
            $(".header_mine i").addClass("fa-caret-up");
            $(".header_mine i").removeClass("fa-caret-down");
            $(".header_mine").css("background-color","#f8f8f8");
        },function () {
            $(this).css("display","none");
            $(".header_mine i").addClass("fa-caret-down");
            $(".header_mine i").removeClass("fa-caret-up");
            $(".header_mine").css("background-color","#fff");
        });
    })
</script>
@endsection